package com.wyd.controller;

import com.wyd.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
public class usercontroller {


    @GetMapping("/login/{username}/{password}")
    public String userlogin(User user, Model model){

        System.out.println(user);
        if(user.getUsername().equals("root")&&user.getPassword().equals("root")){
            model.addAttribute("msg","登录成功");
        }else
            model.addAttribute("msg","登录失败");
        return "test2";

    }
}
